package org.magento.pages;

import org.openqa.selenium.Alert; 
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

//This class presents /admin/customer/ page
 
public class EditCustomerBackEnd extends Page {
	//Locators:
	@FindBy(xpath = "/descendant::div[@class ='content-header']/p[@class='form-buttons']/button[@title='Delete Customer']")
	public WebElement deleteButton;
	
	// Functions 
	public ManageCustomers deleteCustomer() {
		deleteButton.click();
		Alert alert =  driver.switchTo().alert();	 
		alert.accept();	 	   
	 return PageFactory.initElements(driver, ManageCustomers.class);
	}
	//Assertions: 
	public boolean isEditCustomerPageDisplayed() {
		return driver.findElement(By.cssSelector("BODY")).getText().contains("Customer Information");
	}
	
	//Auto - generated
	public EditCustomerBackEnd(WebDriver driver) {
		super(driver);	 
	}

	@Override
	public void open() {	
	}
}
